package com.ss.demo.springbootdemo.web.controller;

import com.ss.demo.springbootdemo.ioc.BeanFactory;
import com.ss.demo.springbootdemo.web.service.DemoService;

/**
 * 作者: MrZhangJR
 * 时间: 2021/11/8 14:27
 * 描述:
 */
public class DemoController {

    private DemoService demoService = (DemoService) BeanFactory.getBean("demoService");

    public void sayHello() {
        demoService.sayHello();
    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            DemoService demoService = (DemoService) BeanFactory.getBean("demoService");
            System.out.println("demoService = " + demoService);
        }

        DemoController demoController = new DemoController();
        demoController.sayHello();
    }
}
